$(function () {
  var layTable = null
	layui.use('table', function () {
    var table = layui.table
    layTable = table

		table.render({
			elem: '#exam-table',
			url: '/Do/MS/queryMsBatchFileJson?' + $("#searchform").serialize(), //数据接口
			page: true,
			cols: [
				[
		      { field: 'examName', title: '序号', width: 60 },
					{ field: 'examName', title: '开考场次', width: '7%'},
					{ field: 'c', title: '科目名称', width: '55%' },
					{ field: 'b', title: '开始时间', width: '10%' },
          { field: 'a', title: '结束时间	', width: '10%' },
					{ field: 'lastEditName', title: '考场', width: '8%' },
					{ field: 'lastEditTime', title: '监考人', width: '10%' },
					{ field: 'lastEditTime', title: '考生', width: '10%' },
				],
			],
    })
  })
  
  $('.exam-details #exam-time').on('click', function() {
    layer.open({
      type: 1,
      title: '设置考试起止时间',
      content: $('#set-time'),
      offset: '30px',
      area: ['900px', '565px']
    })

    layui.use('laydate', function(){
      var laydate = layui.laydate;
      
      laydate.render({
        elem: '#startTime'
      })

      laydate.render({
        elem: '#endTime'
      })
    })
  })

  $('.exam-details #ticket').on('click', function() {
    layer.open({
      type: 1,
      title: '准考证管理',
      content: $('#ticket-manage'),
      offset: '30px',
      area: ['700px', '565px']
    })

    layTable.render({
			elem: '#ticket-table',
			url: '/Do/MS/queryMsBatchFileJson?' + $("#searchform").serialize(), //数据接口
			page: true,
			cols: [
				[
		      { field: 'examName', title: '序号', width: 60 },
					{ field: 'examName', title: '考生编码', width: '20%'},
					{ field: 'c', title: '考生姓名', width: '20%' },
					{ field: 'b', title: '准考证号', width: '60%' },
				],
			],
    })
  })

  $('.exam-details #kaoqian').on('click', function() {
    layer.open({
      type: 1,
      title: '考签',
      content: $('#kaoqian-manage'),
      offset: '30px',
      area: ['750px', '565px']
    })

    layTable.render({
			elem: '#kaoqian-table',
			url: '/Do/MS/queryMsBatchFileJson?' + $("#searchform").serialize(), //数据接口
			page: true,
			cols: [
				[
		      { field: 'examName', title: '序号', width: 60 },
					{ field: 'examName', title: '考签信息', width: '100%'},
				],
			],
    })
  })
})
